import { homeCategoryHead } from "@/api/category"
const state = {
    list: [
        { name: '居家', id: 1 },
        { name: '美食', id: 2 },
        { name: '服饰', id: 3 },
        { name: '母婴', id: 4 },
        { name: '个护', id: 5 },
        { name: '严选', id: 6 },
        { name: '数码', id: 7 },
        { name: '运动', id: 8 },
        { name: '杂项', id: 9 },
        { name: '品牌', id: 10 },
    ]
}
const mutations = {
    setList(state, value) {
        state.list = value
        console.log('列表', value);
    }
}
const actions = {
    async getList({ commit }) {
        const res = await homeCategoryHead()
        commit('setList', res.result)
    }
}
const getters = {}

export default {
    namespaced: true,
    state,
    mutations,
    getters,
    actions
}